import Vue from 'vue'
import VueRouter from 'vue-router'
import index from "@/layout/index";
import Content from '../views/Content.vue'
import PlaySong from "@/layout/PlaySong";
// import Singer from "../layout/Singer"
Vue.use(VueRouter)

const routes = [{
        path: '/',
        name: 'index',
        component: index,
        children: [{
                path: '',
                component: Content,
            },
            {
                path: '/singer',
                name: 'Singer',
                component: () => import('../layout/Singer.vue')
            },
            {
                path: '/singerDetail',
                name: 'SingerDetail',
                component: () => import('../layout/SingerDetail.vue')
            },
            {
                path: '/songList',
                name: 'SongList',
                component: () => import('../layout/SongList.vue'),

            },
            {
                path: '/mine',
                name: 'Mine',
                component: () => import('../layout/Mine.vue'),
                children: [{
                    path: '/mineSong111',
                    name: 'MineSong',
                    component: () => import('../components/MineSong.vue'),
                }]
            },
            {
                path: '/search',
                name: 'Search',
                component: () => import('../layout/Search.vue')
            },
        ]
    },

    {
        path: '/playSong',
        component: PlaySong
    },
    {
        path: '/songListDetail',
        name: 'SongListDetail',
        // route level code-splitting
        // this generates a separate chunk (about.[hash].js) for this route
        // which is lazy-loaded when the route is visited.
        component: () => import( /* webpackChunkName: "about" */ '../layout/SongListDetail')
    },


    {
        path: '/about',
        name: 'About',
        // route level code-splitting
        // this generates a separate chunk (about.[hash].js) for this route
        // which is lazy-loaded when the route is visited.
        component: () => import( /* webpackChunkName: "about" */ '../views/About.vue')
    }
]

const router = new VueRouter({
    routes
})

export default router